package com.wwj.my_ummary;


import java.util.Objects;

public class myPage {
    private Integer page;
    private Integer limit;

    public Integer getPage() {
        return page;
    }

    public void setPage(String  page) {
        Integer p = Integer.valueOf(page);
        if (p == null || p==0) {
            p=1;
        }
        this.page = p;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(String limit) {
        Integer l = Integer.valueOf(limit);
        if (l == null || l==0) {
            l=20;
        }
        this.limit = l;
    }

    public myPage() {
    }



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        myPage myPage = (myPage) o;
        return Objects.equals(page, myPage.page) && Objects.equals(limit, myPage.limit);
    }


    @Override
    public String toString() {
        return "myPage{" +
                "page=" + page +
                ", limit=" + limit +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(page, limit);
    }

    public myPage(Integer page, Integer limit) {
        this.page = page;
        this.limit = limit;
    }
}
